home *** CD-ROM | disk | FTP | other *** search
- '********************************************************************
- '* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- '* CuteFTP Pro Script Template
- '* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- '*This default template script is in VBScript. You can write
- '*scripts in your language of choice and save it with the proper
- '*extenstion, or use your an editor specific to that language.
- '*
- '*
- '*See the TESDK help file for more details on how this scripting
- '*feature works.
- '*You must have Windows Scripting Host installed for the COM enabled
- '*engine to work
- '*
- '*****************************************************************
- 'Look into c:\temp folder to observe local activity (for testing purposes)
- 'or Right Click on the Transfer Engine icon in the systray and select "show current transfers"
- 'Uses an anonymous login to ftp://kyle.globalscape.net
-
- 'First declare a variable called Mysite. This will hold the
- 'reference to the TE COM object.
- Dim MySite
-
- 'Creating a connection object and assign it to the variable
- Set MySite = CreateObject("CuteFTPPro.TEConnection")
-
- ' Now set each property for the site connection
- ' You can omit this section to use the default values, but
- ' you should at least specify the Host
- 'The default Protocol is FTP, however SFTP (SSH2), FTPS (SSL), HTTP, and HTTPS can also be used)
- MySite.Protocol = "FTP"
- MySite.Host = "kyle.globalscape.com"
- 'following lines are optional since the default is anonymous if no login and password are defined
- MySite.Login = "anonymous"
- MySite.Password = "user@user.com"
- 'if necessary, use the UseProxy method and ProxyInfo or SocksInfo properties to connect through a proxy server
- MySite.UseProxy = "BOTH"
- 'now connect to the site (also called called implicitly when a remote method is called)
- MySite.Connect
-
- If (Not Cbool(MySite.IsConnected)) Then
- MsgBox "Could not connect to: " & MySite.Host & "!"
- Quit(1)
- End If
-
- ' If we get this far, our connection has been established.
-
- 'the script will check if the local folder c:\temp exists and create it if necessary
- If (Not (MySite.LocalExists("c:\temp"))) Then
- 'Create it if necessary
- MySite.CreateLocalFolder "c:\temp"
- End If
-
- ' Change TE's local working folder to to c:\temp
- MySite.LocalFolder = "c:\temp"
-
- ' Check for existence of remote folder "/pub/cuteftp"
- b = MySite.RemoteExists("/pub/cuteftp/")
-
- If (Not CBool(b)) Then
- 'tell the user that the folder was not found and quit since i have no
- ' permission to create the remote folder anyway
- MsgBox "Remote folder not found!. Please make sure that the Pub folder exists on the remote site"
- Quit(1)
- End If
-
- ' Now download the index file to the local destination folder
- MySite.Download "/pub/cuteftp/index.txt"
-
- ' Complete. Show the status of this transfer.
- MsgBox "Task done, final status is '" + MySite.Status + "'"
-
-
- 'End of sample script.
- ' You can save you script and then run it by either selecting it from the Tools > Run
- ' Script menu of by double clicking on the script file in Windows
-